# from config.robot import robot_config
# from robot.dingding import DingRobot
#
#
# def test_robot_config():
#     ding_robot = DingRobot.get_instance(robot_config.ding['dxm']['OperationalLogisticsNotification'])
#     ding_robot.send_msg("测试消息", ajax_data={
#         "at": {
#             # "atMobiles": [
#             #     mobile
#             # ],
#             "isAtAll": True
#         },
#         "text": {
#             "content": "测试消息"
#         },
#         "msgtype": "text"
#     })
#
# test_robot_config()

from pyboot.utils.excel import ExcelUtils
from dao.user import select_by_name
from dao.platform import select_platform_by_name
from dao.shop import select_shop_by_name
from dao.operation_shop import insert_operation_list, get_phone_by_platform_and_shop

# data = []
# for line in ExcelUtils.read_excel_to_array(r"C:\Users\bill\Desktop\运营店铺对接一览表.xlsx"):
#     if line[0] is not None:
#         oper_user = select_by_name(line[3])
#         kf_user = select_by_name(line[4])
#         platform = select_platform_by_name(line[0])
#         shop = select_shop_by_name(line[1].strip())
#         phone = ""
#         oper_user_id = 0
#         kf_user_id = 0
#         address = line[2]
#         if address is None:
#             address = ""
#         if len(oper_user) > 0:
#             phone = oper_user[0][2]
#             oper_user_id = oper_user[0][0]
#         if len(kf_user) > 0:
#             kf_user_id = kf_user[0][0]
#         #
#         data.append([shop[0][0], oper_user_id, kf_user_id, phone, address, platform[0][0]])
# for d in data:
#     print(d)
# insert_operation_list(data)

# print(get_phone_by_platform_and_shop("eBay", "catchcostume")[0][0])